<?php
/**
 * @package WordPress
 * @subpackage Elespectador_Theme
 */
$sitio="noticiascaracol.com";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

    <head profile="http://gmpg.org/xfn/11">

        <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

        <title> <?php
if (is_singular()) {
    if (is_single()){
        wp_title('&laquo;', true, 'right');
        echo " | ";
        bloginfo();
        echo ' | ';
    }
    else{
        if (is_front_page()){
            echo "Home | ";
        }
        else{
            echo 'Perfil | ';
            bloginfo();
            echo ' | ';
        }
    }
}
elseif (is_home()){
    echo 'Home | ';
    bloginfo();
    echo ' | ';
}
elseif (is_search()){
    echo 'Resultados de la b&uacute;squeda  | ';
    bloginfo();
    echo ' | ';
}
elseif (is_category()) {
    echo single_cat_title('', false) . " | ";
    bloginfo();
    echo ' | ';
}
elseif (is_tag()) {
    echo "Tags | ";
    bloginfo();
    echo ' | ';
}
elseif (is_month()) {
    echo "Archivo ";
    the_time('F, Y');
    echo " | ";
    bloginfo();
    echo ' | ';
}
echo "Blogs | ".$sitio;
?>
</title>
<?php 
global $blog_id;
$cabezon = "header_noticias.html";
$estilo = "noticias.css";
$hide_menu='';
$header = sprintf(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/wp-content/themes/elespectador/" . $cabezon), get_bloginfo(url),$_SERVER['SCRIPT_URI']);
if (is_user_logged_in()) {
    $current_user = wp_get_current_user();
    $reemplazo = get_string_between($header, '<p class="usuarioLinks">', '</p>');
 if (!in_array("subscriber", $current_user->roles)) {
	 $vardire= get_blogaddress_by_id($current_user->primary_blog);
        $header = str_replace('<p class="usuarioLinks">' . $reemplazo . '</p>', '<p class="usuarioLinks"> <a href="'.$vardire.'wp-admin">'.$current_user->user_login.'</a> / <a href="'.wp_logout_url().'&amp;redirect_to='.$_SERVER['SCRIPT_URI'].'">Cerrar sesi&oacute;n</a></p>', $header);
 }
 else{
     $hide_menu='<style>html {
    margin-top: 0px !important;
}#wpadminbar{display: none;}</style>';   
     $header = str_replace('<p class="usuarioLinks">' . $reemplazo . '</p>', '<p class="usuarioLinks"> <a href="http://www.'.$sitio.'/zonausuario/'.$current_user->user_login.'">'.$current_user->user_login.'</a> / <a href="'.wp_logout_url().'&amp;redirect_to='.$_SERVER['SCRIPT_URI'].'">Cerrar sesi&oacute;n</a></p>', $header);
 }
}
?>
        
        <!--<link rel="stylesheet" href="<?php // bloginfo('stylesheet_url');  ?>" type="text/css" media="screen" />-->
        <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
        <link href="<?php echo get_template_directory_uri(); ?>/css/generales.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo get_template_directory_uri(); ?>/css/general.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo get_template_directory_uri(); ?>/css/moduloResultados.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo get_template_directory_uri(); ?>/css/despliegues.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo get_template_directory_uri(); ?>/css/blogs.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo get_template_directory_uri(); ?>/css/<?php echo $estilo ?>" rel="stylesheet" type="text/css"/>
        <link href="<?php echo get_template_directory_uri(); ?>/css/blogs/<?php echo $blog_id ?>.css" rel="stylesheet" type="text/css"/>
        <link rel="shortcut icon" href="<?php echo get_template_directory_uri(); ?>/images/favicon.ico" type="image/x-icon" /> 

        <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/jquery.js"></script>



        <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/functions.js"></script>
        <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/e-planning.js"></script>
        <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/e-planning/inicial.js"></script>
        <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/e-planning/index.js"></script>
        <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/e-planning/archive.js"></script>
        <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/e-planning/single.js"></script>
        <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/e-planning/search.js"></script>




        <style type="text/css" media="screen">

        <?php
// Checks to see whether it needs a sidebar or not
        if (empty($withcomments) && !is_single()) {
            ?>
                #page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg-<?php bloginfo('text_direction'); ?>.jpg") repeat-y top; border: none; }
        <?php } else { // No sidebar ?>
                #page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
<?php } ?>

        </style>

<?php if (is_singular())
    wp_enqueue_script('comment-reply'); ?>

<?php wp_head(); ?>
<?php
/*GOLCARACOLif (isset($seccion[0])) {
    if ($seccion[0]->image == 'gol') {
        ?>
                <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/nuevos/jquery-1.4.2.min.js"></script>
                <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/nuevos/tabcontent.js"></script>
                <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/nuevos/jcarousellite.js"></script>
    <?php }
}*/ ?>

        <!-- Begin comScore Tag -->
        <script>
            var _comscore = _comscore || [];
            _comscore.push({ c1: "2", c2: "7109911" });
            (function() {
                var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true;
                s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js";
                el.parentNode.insertBefore(s, el);
            })();
        </script>
        <noscript>
            <img src="http://b.scorecardresearch.com/p?c1=2&c2=7109911&cv=2.0&cj=1" />
        </noscript>
        <!-- End comScore Tag -->
      <?php echo $hide_menu;?>
    </head>
    <body <?php //body_class();  ?>>
        <div id="content_all">
<?php
echo $header;
?>
            <div class="back_prod">
                <div class="content_body">
